package com.example.components.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Map;

/**
 * User: lu
 * Date: 2022/4/19
 * Time: 16:56
 * Version: 1.0
 * Modified By:
 * Description:
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Rule {

      /*
      - alert: 主机状态
        expr: up{job="node_exporter"} == 0
        for: 1m
        labels:
          status: 严重告警
          level: critical
        annotations:
          summary: "{{$labels.instance}}:服务器宕机"
          description: "{{$labels.instance}}:服务器延时超过5分钟"*/

    String alert;

    String expr;

    @JsonProperty(required = true, value = "for")
    String forName;

    private Map<String, String> labels;
    //    DawnCacheEvict dawnCacheEvict = AnnotationUtils.getAnnotation(method, DawnCacheEvict.class);

    private Map<String, String> annotations;


}